# 进入练习网页：https://vip.ceshiren.com/#/ui_study/frame
# 获取 frame1 中的表格文字
# 传入 id 切换 frame
# 回到默认页面

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
import time


def work_frame():
  driver=webdriver.Chrome()
  driver.get("https://vip.ceshiren.com/#/ui_study/frame")
  time.sleep(5)
  driver.switch_to.frame("frame1")
  table_content=driver.find_element(By.CLASS_NAME,"el-table")
  print(table_content.text)

  driver.switch_to.default_content()
  #切换frame2
  driver.switch_to.frame("frame2")

  time.sleep(5)
  driver.switch_to.default_content()
if __name__ == '__main__':
  work_frame()